<template>
  <nav-container class="report-center" :nav="nav">
    <router-view></router-view>
  </nav-container>
</template>

<script>
  export default {
    name: "report-center",
    data() {
      return {
        nav: [
          {
            title: "财务总报表",
            isShow: true,
            to: {
              name: 'report-finance',
            }
          },
          {
            title: "游戏输赢报表",
            isShow: true,
            to: {
              name: 'report-game-win-lose',
            }
          },
          {
            title: "存提明细报表",
            isShow: true,
            to: {
              name: 'report-deposit-forward',
            }
          },
          {
            title: "红利返水报表",
            isShow: true,
            to: {
              name: 'report-dividend',
            }
          },
          {
            title: "佣金报表",
            isShow: true,
            to: {
              name: 'report-broke-rage',
            }
          },
          {
            title: "上分报表",
            // permission: 'isCreditUp',
            isShow: true,
            to: {
              name: 'report-top-score',
            }
          },
          {
            title: "会员首存报表",
            isShow: true,
            to: {
              name: 'report-first-recharge',
            }
          },
          // {
          //   title: "代理上分报表",
          //   permission: 'isCreditUpAgent',
          //   isShow: false,
          //   to: {
          //     name: 'report-upper-sum',
          //   }
          // },
        ]
      };
    },

    watch: {
      isCreditUp: {
        handler(isCreditUp) {
          _(this.nav).filter({permission: 'isCreditUp'}).each(tab => {
            tab.isShow = isCreditUp;
          });

        },
        immediate: true
      },
      isCreditUpAgent: {
        handler(isCreditUpAgent) {
          _(this.nav).filter({permission: 'isCreditUpAgent'}).each(tab => {
            tab.isShow = isCreditUpAgent;
          });

        },
        immediate: true
      }
    },


    computed: {
      ...mapGetters([
        'isCreditUp',
        'isCreditUpAgent'
      ]),
    },
  };
</script>

<style lang="scss" scoped>
  @include b(report-center) {

    width: 100%;
    height: auto;
    .reportTab {
      width: 100%;
      height: 83px;
      background: rgba(243, 243, 243, 1);
      padding: 0 50px;
      line-height: 83px;
      > li {
        float: left;
        width: 16.6%;
        font-size: 17px;
        font-family: MicrosoftYaHei-Bold;
        font-weight: bold;
        color: rgba(0, 0, 0, 1);
        text-align: center;
      }
      .active {
        font-size: 17px;
        font-family: MicrosoftYaHei-Bold;
        font-weight: bold;
        color: rgba(30, 90, 220, 1);
      }
    }
  }
</style>

